#include<stdio.h>
#include<unistd.h>
#include<sys/types.h>


int main()
{
    pid_t id = fork();
    printf("id = %d\n", id);
   //while(1)
   {    
        if(id == 0)
        {
            while(1)
             //子进程
             printf("child  pid:%d  ,ppid:%d\n", getpid(), getppid()),
             sleep(1);
        }
        else 
        {
            while(1)
            printf("parnet  pid:%d  ,ppid:%d\n", getpid(), getppid()),
            sleep(1);
        }
        return 0;
    }
}
